﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data.SqlClient;
using System.Data;
using System.Collections;

using XJX.DataLayer;

namespace XJX.BusinessLayer
{
    public class Log
    {
        private string ConnToData;

        public Log(string newConnectionString)
        {
            ConnToData = newConnectionString;
        }

        //验证用户登录
        public int Verification_User_Log
            (
            string mobile,
            string pwd,
            out string ReturnFieldValue   //返回字段值
            )
        {
            int b;

            try
            {
                b = new XJX.DataLayer.Log(ConnToData).Verification_User_Log(mobile, pwd, out ReturnFieldValue);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }

        //修改密码
        public bool Modify_One_Family_PWD(string UID, string PWD)
        {
            bool b;

            try
            {
                b = new XJX.DataLayer.Log(ConnToData).Modify_One_Family_PWD(UID, PWD);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }


        public bool Add_New_Log
        (
            string UID
            )
        {
            bool b;

            try
            {
                b = new XJX.DataLayer.Log(ConnToData).Add_New_Log(UID);
            }
            catch (SqlException e)
            {
                throw new System.Exception(e.Message);
            }
            return b;
        }

    }
}
